﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TresselLS
{
    public partial class LoadModuleForm : Form
    {
        public LoadModuleForm(TresselLS.TresselLinker tl)
        {
            /*!
            Procedure Name: LoadModuleForm
            Description: intializes the form with the load module and linker table
            Input Parameters: TresselLS.TresselLinker tl
            Output Parameters: none
            Error Conditions Tested:
            Error Messages Generated:
            Original Author: Steve Rudy
            Procedure Creation Date: 11/24/2009
            Modification Log:
            Coding Standards Met: SR
            Testing Standards Met: RM
            !*/
            InitializeComponent();
            if (tl != null)
            {
                this.moduleDataGridView.Rows.Add(tl.HeaderRecord);
                for (int i = 0; i < tl.TextRecords.Count; i++)
                {
                    moduleDataGridView.Rows.Add(((TextRecord)tl.TextRecords[i]).Text());
                }
                moduleDataGridView.Rows.Add(tl.EndRecord);
                this.loadMapDataGridView.DataSource = tl.SymbolTable;
            }
        }
    }
}
